package org.grill.fatwhacker.gui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;

public class Utils {

	public static void setBoldFont(Label l) {
		Display display = l.getDisplay();
		FontData data = l.getFont().getFontData()[0];
		data.setStyle(SWT.BOLD);
		final Font f = new Font(display, data);
		l.setFont(f);
		l.addDisposeListener(new DisposeListener() {
		
			public void widgetDisposed(DisposeEvent arg0) {
				f.dispose();
			}
		
		});
	}

}
